package com.announcement.sevice.Impl;

import java.sql.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.announcement.dao.UserDao;
import com.announcement.entity.User;
import com.announcement.sevice.UserService;

@Transactional
@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserDao userDao;

	@Override
	public void test() {
		// TODO Auto-generated method stub

		userDao.test();
		System.out.println("serviceimpl");
	}

	 
	@Override
	public User verifyUser(User user) {
		User result = userDao.verifyUser(user);
		return result;
	}

	 
	@Override
	public boolean register(User user) {
		user.setRegisterDate(new Date(System.currentTimeMillis()));
		boolean status = userDao.register(user);
		return status;
	}

	 
	@Override
	public boolean updateUser(User user) {
		// TODO Auto-generated method stub
		return userDao.updateUser(user);
	}

	@Override
	public User findUserByName(String userName) {
		// TODO Auto-generated method stub
		return userDao.findUserByName(userName);
	}

}
